var data;
$(document).ready(function() {
	    $("#uploadImage").on("change",function(){
        var files= !!this.files?this.files:[];
        if(!files.length||!window.FileReader)
        	return;
        if(/^image/.test(files[0].type)){
            var reader = new FileReader();
            reader.readAsDataURL(files[0]);
            reader.onloadend = function(){
            	$("#uploadform").attr("action","../api/file/upload?token="+basedata.token).submit(function(e){
                	$(this).ajaxSubmit(function(message) {
						data=message.datum.photoimage;
						$("#uploadPreview").css("background-image","url("+data+")");
					});
                	return false;
              });
            $("#sub").trigger("click");
            };
        }
    });
});
function publishShow(data) {
	var $description = $("#description").val();
	var updatedata= "&stype=1&scomment="+$description+"&simage="+data;
	var Post = "mid="+basedata.mid+"&groupid="+basedata.groupid+"&token="+basedata.token+"&did="+commondata.groupshow+updatedata;
	$.ajax({
		url:'../api/group/sendshowmeinfo',
		type:'post',
		data:Post,
		success:function(msg){
			
		}
	});
}